<!doctype html>
<html>
<head>
    <title>设置</title>
    <?php $this->load->module('admin/index/page_header');?>
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/select2/select2.min.js"></script>
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/select2/select2_locale_zh-CN.js"></script>
    <link href="<?php echo URLPRE;?>static/public/Lib/select2/select2.css" rel="stylesheet" />
    <link href="<?php echo URLPRE;?>static/public/Lib/select2/select2-bootstrap.css" rel="stylesheet" />
    <!--引入CSS-->
    <link rel="stylesheet" type="text/css" href="<?php echo URLPRE;?>static/public/Lib/webuploader/webuploader.css">
    <!--引入JS-->
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/webuploader/webuploader.js"></script>
    <script type="text/javascript" src="<?php echo URLPRE;?>static/admin/js/common.js?newversion"></script>
</head>
<body>
<div class="wrap">
    <div class="nav">
        <ul>
            <li class="current"><a href="<?php echo site_url('weixin/admin/new_send/?list_id='.$_GET['list_id'])?>">返回</a></li>
        </ul>
    </div>
    <div class="table_full">
        <form class="formvalidate" action="" method="post" >
            <div class="h_a"><?php echo !empty($data) ? '编辑消息 - ID:'. $data['id'] : '新建群发消息'?></div>
            <div class="table_full">
                <table width="100%">
                    <col class="th" />
                    <col/>
                    <tbody>
                    <tr>
                        <th>作者</th>
                        <td><input type="text" class="input rounded" name="row[author]" validate="{required:true}" value="<?php
                            echo empty($data['author']) ? '' : $data['author'];
                        ?>"/></td>
                    </tr>
                    <tr>
                        <th>标题</th>
                        <td><input type="text" class="input rounded" name="row[title]" validate="{required:true}" value="<?php echo empty($data['title']) ? '' : $data['title']; ?>" /></td>
                    </tr>
                    <tr>
                        <th>描述</th>
                        <td><textarea name="row[digest]" validate="{required:true}"><?php echo empty($data['digest']) ? '' : $data['digest'];?></textarea></td>
                    </tr>
                    <tr>
                        <th>内容</th>
                        <td><textarea name="row[content]" validate="{required:true}"><?php echo empty($data['content']) ? '' : $data['content'];?></textarea></td>
                    </tr>
                    <tr>
                        <th>原文链接</th>
                        <td><input type="text" class="input rounded" name="row[content_source_url]" validate="{required:true}" value="<?php echo empty($data['content_source_url']) ? '' : $data['content_source_url'];?>"/></td>
                    </tr><?php echo empty($data['shw']) ? '' : '';?>
                    <tr>
                        <th>否显示封面</th>
                        <td>
                            <label><input type="radio" name="row[show_cover_pic]" <?php echo !isset($data['show_cover_pic']) ? 'checked' : ($data['show_cover_pic'] == 1 ? 'checked' : '');?> value="1"  />是</label>
                            <label><input type="radio" name="row[show_cover_pic]" value="0" <?php echo !isset($data['show_cover_pic']) ? '' : ($data['show_cover_pic'] == 0 ? 'checked' : '');?> />否</label>
                        </td>
                    </tr>
                    <tr>
                        <th>图片</th>
                        <td>
                            <ul>
                                <li><div id="filePicker">选择图片</div></li>
                                <li>
                                    <input validate="{required:true}" type="text" readonly class="input rounded" size="30" name="row[thumb]" id="file_url" value="<?php echo empty($data['thumb']) ? '' : $data['thumb'];?>" />
                                </li>
                                <?php if(! empty($data['thumb'])){?>
                                    <li>
                                        <img src="<?php echo URLPRE. $data['thumb'];?>" height="70" />
                                    </li>
                                <?php }?>
                            </ul>
                        </td>
                    </tr>

                    <tr>
                        <th>排序</th>
                        <td>
                            <input type="text" class="input rounded" name="row[displayorder]" value="<?php echo empty($data['displayorder']) ? '0' : $data['displayorder'];?>" />
                        </td>
                    </tr>
                    <tr>
                        <th>&nbsp;</th>
                        <td>
                            <input type="hidden" name="row[list_id]" value="<?php echo $list_id?>" />
                            <input type="hidden" name="row[thumb_media_id]" value="<?php echo empty($data['thumb_media_id']) ? '' : $data['thumb_media_id'];?>" />

                            <input type="hidden" name="old_thumb" value="<?php echo empty($data['thumb']) ? '' : $data['thumb'];?>" />
                            <input type="hidden" name="id" value="<?php echo empty($data['id']) ? '0' : $data['id'];?>" />
                            <input type="submit" class="btn btn_submit J_ajax_submit_btn" value="保存" />
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </form>
    </div>
</div>

<script type="text/javascript">
    upload_image("<?php echo site_url('admin/upload/ajax_upload/');?>",'filePicker','file_url');
</script>
</body>
</html>